<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="../gvis.js"></script>
<?php

	$chartNum = 1;
  	require_once '../classes/gvisWriter.php';
  	$gvisJSObject = new gvisWriter($chartNum,'piechart', "piechart_div{$chartNum}", "width: 400, height: 240, is3D: true, title: 'Title of First Chart'");
	$gvisJSObject->addRow(array('ONE', 1000));
	$gvisJSObject->addRow(array('TWO', 2000));
	$gvisJSObject->addRow(array('THREE', 3000));		
  	echo $gvisJSObject->getScriptString();
  	
    // increment chartNum and make sure you have corresponding unique div for the charts in the body
  	$gvisJSObject = new gvisWriter(++$chartNum,'piechart', "piechart_div{$chartNum}", "width: 400, height: 240, is3D: true, title: 'Title of 2nd Chart', backgroundColor: {stroke:'black', fill:'#eee', strokeSize: 1}");
	$gvisJSObject->addRow(array('Blue', 123));
	$gvisJSObject->addRow(array('Red', 231));
	$gvisJSObject->addRow(array('Green', 312));		
  	echo $gvisJSObject->getScriptString();  	
?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Example gvisWriter.php Pie Chart</title>
</head>
<body>
<h1>Multi-chart example using Google Visualizations with gvis.js and gvisWriter.php</h1>
	<h2> Chart #1</h2>
    <div id='piechart_div1'></div><br/>
    <h2> Chart #2</h2>
    <div id='piechart_div2'></div>
</body>
</html>